<template>
  <section class='container'>
  
    <FormItem :form-items="formItem" @enter-key="handleQuery" @button-click="handleButtonClick" />
    <Table :columns="tableColumns" :data="data" />
   
  </section>
</template>

<script lang='ts' setup>
import FormItem from '~/components/FormItem.vue';
import Table from '~/components/Table.vue';
import {  cooperation as formdata, cooperationColumns as tableColumns } from './data'
const options = ref<any[]>([]) // 投放渠道

const formItem = ref<any>([]) // 表单
const data = ref<any>([]) // 表格数据
  onMounted(async () => {
    formItem.value =  (formdata(options)) // 表单
    data.value = [
      {
        banner: 'http://editerupload.eepw.com.cn/fetch/202305/2e4540737c21a5a6a26efefde1014597.jpeg',
        title_cn: '地产类金融服务',
        desc: '公司主要为国内房地产开发企业提供金融服务，与国内外大型银行、信托等金融机构进行深度合作，并运用创新性的金融模式，服务于地产金融生态链。',
        createTime: '2023-01-01 12:00:00',
        updateTime: '2023-01-01 12:00:00',
        createUser: '张三',
        updateUser: '李四',
        status: 1,
      },
    ]
})

const handleQuery = () => {
  console.log('query')
}
const handleButtonClick = (type: string, params: any, item?: any) => {
  // 按钮点击事件
  console.log('您点击了', type, params, item)
}
</script>

<style scoped lang='stylus'>
.container{ 
  padding 20px
}
</style>